package acm.蓝桥杯模拟;

import java.util.Scanner;

public class 爬台阶 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println(dpFun(sc.nextInt()));
    }
    public static int fun(int n) {
        if (n<=3){
            return 1;
        }
        int res=Integer.MAX_VALUE;
        res=Math.min(res,fun(n-1));
        res=Math.min(res,fun(n-2));
        res=Math.min(res,fun(n-3));
        return res+1;
    }
    public static int dpFun(int n){
        int[] dp=new int[n+1];
        dp[1]=1;
        dp[2]=1;
        dp[3]=1;
        for (int i = 4; i < dp.length; i++) {
            dp[i]=Math.min(dp[i-1],dp[i-2]);
            dp[i]=Math.min(dp[i],dp[i-3]);
            dp[i]++;
        }
        return dp[n];
    }
}
